package org.example.petadoption.controller;

import org.example.petadoption.entity.ProductCategory;
import org.example.petadoption.entity.ResultBody;
import org.example.petadoption.service.IProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author PetAdoption
 * @since 2025-10-20
 */
@RestController
@RequestMapping("/productCategory")
public class ProductCategoryController {
    @Autowired
    IProductCategoryService service;

    @GetMapping("/getProductCat")
    public ResultBody getProductCat() {
        List<ProductCategory> data = service.list();
        return ResultBody.success("查询成功",data);
    }

}
